package ar.edu.itba.it.cg.grupo01.impl.shape;

import java.awt.Color;
import java.util.List;

import javax.vecmath.Point3d;

import ar.edu.itba.it.cg.grupo01.impl.IntersectionFactory;

public class MeshRectangle extends TriangleMesh {

	public MeshRectangle(final Point3d a, final Point3d b, final Point3d c,
			IntersectionFactory intersectionFactory) {
		this(a, b, c, intersectionFactory, null);
	}
	
	public MeshRectangle(final Point3d a, final Point3d b, final Point3d c,
			IntersectionFactory intersectionFactory, Color color) {

		super(getTriangles(a,b,c), intersectionFactory);
	}
	
	private static List<Triangle> getTriangles(Point3d a, Point3d b, Point3d c) {
		
//		List<Point3d> points = Utilities.pointsFormRightTriangle(a, b, c);
//		
//		if (points == null) {
//			throw new RuntimeException("Specified points do not describe a rectangle");
//		}
//		
//		Point3d r1 = points.get(0);
//		Point3d p = points.get(1);
//		Point3d q = points.get(2);
//		
//		Vector3d v = new Vector3d(p);
//		v.sub(r1);
//		
//		Point3d r2 = new Point3d(q);
//		r2.add(v);
//		
//		List<Triangle> rectriangles = new ArrayList<Triangle>();
//		Triangle t1 = new Triangle(p, q, r1, intersectionFactory);
//		Triangle t2 = new Triangle(p, q, r2, intersectionFactory);
//		rectriangles.add(t1);
//		rectriangles.add(t2);
//		
//		return rectriangles;
		return null;
		//FIXME
	}

}

